#ifndef WXSBITMAPICONPROPERTY_H
#define WXSBITMAPICONPROPERTY_H

#include "../../properties/wxsproperties.h"
#include "../wxscodercontext.h"

#include <wx/artprov.h>



struct wxsBitmapIconData {
  wxString Id;
  wxString Client;
  wxString FileName;
  wxString CodeText;


  wxBitmap GetPreview( const wxSize& Size, const wxString& DefaultClient = wxART_OTHER );


  wxString BuildCode( bool NoResize, const wxString& SizeCode, wxsCoderContext* Context, const wxString& DefaultClient = wxART_OTHER );


  bool IsEmpty();
};

typedef wxsBitmapIconData wxsBitmapData;
typedef wxsBitmapIconData wxsIconData;


class wxsBitmapIconProperty: public wxsCustomEditorProperty {
  public:


    wxsBitmapIconProperty(
      const wxString& PGName,
      const wxString& DataName,
      long Offset,
      const wxString& DefaultClient = _T( "wxART_OTHER" ),
      int Priority = 100 );


    virtual const wxString GetTypeName() { return _T( "wxBitmapIcon" ); }


    virtual bool ShowEditor( wxsPropertyContainer* Object );

  protected:

    virtual bool XmlRead( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool XmlWrite( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool PropStreamRead( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
    virtual bool PropStreamWrite( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
    virtual wxString GetStr( wxsPropertyContainer* Object );

  private:

    long Offset;
    wxString DefaultClient;
};

typedef wxsBitmapIconProperty wxsBitmapProperty;
typedef wxsBitmapIconProperty wxsIconProperty;





#define WXS_BITMAP(ClassName,VarName,PGName,DataName,DefaultArtClient) \
  { static wxsBitmapProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),DefaultArtClient); \
    Property(_Property); }


#define WXS_BITMAP_P(ClassName,VarName,PGName,DataName,DefaultArtClient,Priority) \
  { static wxsBitmapProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),DefaultArtClient,Priority); \
    Property(_Property); }


#define WXS_ICON(ClassName,VarName,PGName,DataName,DefaultArtClient) \
  { static wxsIconProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),DefaultArtClient); \
    Property(_Property); }


#define WXS_ICON_P(ClassName,VarName,PGName,DataName,DefaultArtClient,Priority) \
  { static wxsIconProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),DefaultArtClient,Priority); \
    Property(_Property); }




#endif
